Backport path_find_first_component()
authorArnaud Rebillout <arnaudr@debian.org>
Tue, 7 Apr 2026 01:03:53 +0000 (08:03 +0700)
committerArnaud Rebillout <arnaudr@debian.org>
Mon, 13 Apr 2026 07:18:40 +0000 (14:18 +0700)
commit31645c408e64d16529e974e363f804b2451a64be
treef9fb5ec6e350932fe65b42fe2fb0c3858b0a8316
parente0dee9ba508e29dc77a18c022c271ab15b9f330b
Backport path_find_first_component()

This is a prerequisite to backport path_startswith_full().

path_find_first_component() was introduced in systemd v249, in commit
0ee54dd4e2f: "path-util: introduce path_find_first_component()".

The function didn't change since it was introduced: it's still the same code in
systemd v260. However the test associated with it was slightly adjusted
afterward.

This commit backports the fonction and associated unit tests from systemd v260
(ie. with the latest version of the unit tests).

Forwarded: not-needed

Gbp-Pq: Name CVE-2026-29111-1.patch
src/basic/path-util.c
src/basic/path-util.h
src/test/test-path-util.c